package com.io;

import java.io.*;

public class Test_5 {
    public static void main(String[] args) throws IOException {
        //序列化存储
        String path="D:\\javacode\\javacode\\J2024_11_17\\c.dat";
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(new FileOutputStream(path));
        objectOutputStream.writeInt(5);
        objectOutputStream.writeDouble(423.65);
        objectOutputStream.writeBoolean(false);
     //   objectOutputStream.writeChars("hello,my daring");
        objectOutputStream.writeObject(new Dog("张儿",6));
        objectOutputStream.writeUTF("你好呀,最近过得好吗");
        objectOutputStream.close();

    }
}
